package Jcat.cduestcbbs.Service;

import java.sql.SQLException;

import Jcat.cduestcbbs.Po.PostsPo;
import Jcat.cduestcbbs.DaoImpl.PostsDaoImpl;

public class AddNewPostsService {

	PostsDaoImpl insertPosts = new PostsDaoImpl();

	public boolean ifLogin(String session ){
		
		if(session != null && session.equals("OK")){
			return false;
		} else {
			return true;
		}
	}

	public boolean insertNewPosts(PostsPo posts) {

		try {
			if (insertPosts.insertPosts(posts) == false) {
				return false;
			} else {
				return true;
			}
		} catch (SQLException e) {
			e.printStackTrace();
			return false; 
		}

	}
}
	



